#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, a[1000005], ans = 0, gj, gs, h[1000005];
map<int, int> mp;
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for (int i = 1; i <= n; i ++){
        scanf("%d", &a[i]);
        mp[a[i]]++;
    }
    sort(a + 1,  a + n + 1);
    gj = a[1], gs = 0;
    int x, y;
    x=y=0;
    for (int i = 1; i <= n; i ++){
        //if (!h[a[i]]){
        //    cout << a[i] << ' '<<mp[a[i]] << "\n";
        //    h[a[i]] = 1;  
        //}
        if (a[i] > gj){
            if (gj != a[1]) ans-=min(gs, ans);
            ans += gs;
            gs = 0, gj = a[i];
        }
        gs ++;
    }
    ans -= min(gs, ans);
    ans += gs;
    printf("%d\n", ans);
    return 0;
}